@echo off

:: 创建发布目录
mkdir release
del /Q release\*

:: 打包前端
cd frontend
call npm install
call npm run build
cd ..

:: 将静态文件转换为go代码
%GOPATH%\bin\go-bindata -o assets/bindata.go -pkg assets -prefix "static" ./static/...

:: 编译后端
set CGO_ENABLED=1
go build -ldflags "-s -w" -o release/mypassword-embed.exe

:: 创建必要目录
mkdir release\cert
mkdir release\data 